//
//  TestViewController.m
//  QuTouTiao
//
//  Created by 杨杨子 on 2018/6/19.
//  Copyright © 2018年 杨杨子. All rights reserved.
//

#import "TestViewController.h"
#import "QTTLaunchViewController.h"
#import "QTTFirstPageViewController.h"
#import "QTTPublicAlertView.h"
#import "QTTPublicOneBtnAlertView.h"
#import "QTTXWBTAlertView.h"

@interface TestViewController ()

@end

@implementation TestViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor yellowColor];
    
    UIButton *quitBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 100, 80, 40)];
    [self.view addSubview:quitBtn];
    quitBtn.backgroundColor = [UIColor redColor];
    [quitBtn setTitle:@"强制升级" forState:UIControlStateNormal];
    [quitBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    [quitBtn addTarget:self action:@selector(quitBtnAction:) forControlEvents:UIControlEventTouchUpInside];
    //
    UIButton *lingQuBtn = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(quitBtn.frame), CGRectGetMinY(quitBtn.frame), 80, 40)];
    [self.view addSubview:lingQuBtn];
    lingQuBtn.backgroundColor = [UIColor redColor];
    [lingQuBtn setTitle:@"领取" forState:UIControlStateNormal];
    [lingQuBtn addTarget:self action:@selector(lingQuBtnAction:) forControlEvents:UIControlEventTouchUpInside];
    [lingQuBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    //
    UIButton *biaotiBtn = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(lingQuBtn.frame), CGRectGetMinY(lingQuBtn.frame), 80, 40)];
    [self.view addSubview:biaotiBtn];
    biaotiBtn.backgroundColor = [UIColor redColor];
    [biaotiBtn setTitle:@"新闻标题" forState:UIControlStateNormal];
    [biaotiBtn addTarget:self action:@selector(biaotiBtnAction:) forControlEvents:UIControlEventTouchUpInside];
    [biaotiBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    
    
     
}
-(void)biaotiBtnAction:(UIButton *)sender{
    QTTXWBTAlertView *alertView = [[[NSBundle mainBundle] loadNibNamed:@"QTTXWBTAlertView" owner:self options:nil] lastObject];
    [alertView awakeFromNibAndTittle:@"新闻标题" AndLeftImageName:@"u12" AndLeftBtnStr:@"查看" AndRightStr:@"忽略" AndLeftBlock:^{
        NSLog(@"左边");
    } AndRightBlock:^{
        NSLog(@"右边");
    } AndFatherView:self.view];
}
-(void)lingQuBtnAction:(UIButton *)sender{
    QTTPublicOneBtnAlertView *alertView = [[[NSBundle mainBundle] loadNibNamed:@"QTTPublicOneBtnAlertView" owner:self options:nil] lastObject];
    [alertView awakeFromNibAndTittle:@"领取新人红包，即可提现哦！！" AndBtnStr:@"领取" AndBlock:^{
        NSLog(@"中间");
    } AndFatherView:self.view];
}
-(void)quitBtnAction:(UIButton *)sender{

    QTTPublicAlertView *alertView = [[[NSBundle mainBundle] loadNibNamed:@"QTTPublicAlertView" owner:self options:nil] firstObject];
    [alertView awakeFromNibAndTittle:@"版本升级1.1.1\n1、优化界面\n2、解决一些BUG" AndLeftBtnStr:@"取消" AndRightStr:@"确定" AndLeftBlock:^{
        NSLog(@"左边");
    } AndRightBlock:^{
        NSLog(@"右边");
    } AndFatherView:self.view];
//    [self.view addSubview:alertView];
    
}

-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
//    QTTLaunchViewController *launchVc = [[QTTLaunchViewController alloc] init];
    
    QTTFirstPageViewController *firstVc = [[QTTFirstPageViewController alloc] init];
    [self presentViewController:firstVc animated:YES completion:nil];
    
    
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
